<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Aria: ArSonarConnector Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aria
   &#160;<span id="projectnumber">2.9.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classArSonarConnector.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classArSonarConnector-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ArSonarConnector Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Connect to sonar based on robot parameters and command-line arguments.  
 <a href="classArSonarConnector.html#details">More...</a></p>

<p><code>#include &lt;ArSonarConnector.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector_1_1SonarData.html">SonarData</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class that holds information about the sonar data.  <a href="classArSonarConnector_1_1SonarData.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8746703bfabfac28f5165ac21e56a998"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a8746703bfabfac28f5165ac21e56a998">addSonar</a> (<a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *sonar, int sonarNumber=1)</td></tr>
<tr class="memdesc:a8746703bfabfac28f5165ac21e56a998"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a sonar so parsing will get it.  <a href="#a8746703bfabfac28f5165ac21e56a998">More...</a><br /></td></tr>
<tr class="separator:a8746703bfabfac28f5165ac21e56a998"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac37f03297a9f3158a7f1daf5bdb40de3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#ac37f03297a9f3158a7f1daf5bdb40de3">ArSonarConnector</a> (<a class="el" href="classArArgumentParser.html">ArArgumentParser</a> *parser, <a class="el" href="classArRobot.html">ArRobot</a> *robot, <a class="el" href="classArRobotConnector.html">ArRobotConnector</a> *robotConnector, bool autoParseArgs=true, <a class="el" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3">ArLog::LogLevel</a> infoLogLevel=<a class="el" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a6e80d09c67dad73e9ba736e91ec893be">ArLog::Verbose</a>, <a class="el" href="classArRetFunctor1.html">ArRetFunctor1</a>&lt; bool, const char * &gt; *turnOnPowerOutputCB=NULL, <a class="el" href="classArRetFunctor1.html">ArRetFunctor1</a>&lt; bool, const char * &gt; *turnOffPowerOutputCB=NULL)</td></tr>
<tr class="memdesc:ac37f03297a9f3158a7f1daf5bdb40de3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor that takes argument parser.  <a href="#ac37f03297a9f3158a7f1daf5bdb40de3">More...</a><br /></td></tr>
<tr class="separator:ac37f03297a9f3158a7f1daf5bdb40de3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a258ffd5efb72838a85fb2d65be8921cb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a258ffd5efb72838a85fb2d65be8921cb"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>connectReplaySonars</b> (bool continueOnFailedConnect=false, bool addConnectedSonarsToRobot=true, bool addAllSonarsToRobot=false, bool turnOnSonars=true, bool powerCycleSonarOnFailedConnect=true)</td></tr>
<tr class="separator:a258ffd5efb72838a85fb2d65be8921cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2804f2cf1e774e01ff01796fab62380"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#af2804f2cf1e774e01ff01796fab62380">connectSonar</a> (<a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *sonar, int sonarNumber=1, bool forceConnection=true)</td></tr>
<tr class="memdesc:af2804f2cf1e774e01ff01796fab62380"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects the sonar synchronously (will take up to a minute)  <a href="#af2804f2cf1e774e01ff01796fab62380">More...</a><br /></td></tr>
<tr class="separator:af2804f2cf1e774e01ff01796fab62380"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff4cf06b8187ee5c758c81381a4fe7e4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aff4cf06b8187ee5c758c81381a4fe7e4"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#aff4cf06b8187ee5c758c81381a4fe7e4">connectSonars</a> (bool continueOnFailedConnect=false, bool addConnectedSonarsToRobot=true, bool addAllSonarsToRobot=false, bool turnOnSonars=true, bool powerCycleSonarOnFailedConnect=true)</td></tr>
<tr class="memdesc:aff4cf06b8187ee5c758c81381a4fe7e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects all the sonars the robot has that should be auto connected. <br /></td></tr>
<tr class="separator:aff4cf06b8187ee5c758c81381a4fe7e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaabbea9baffb613be6b0e572be77429d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaabbea9baffb613be6b0e572be77429d"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>disconnectSonars</b> ()</td></tr>
<tr class="separator:aaabbea9baffb613be6b0e572be77429d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad886f21681458f0e089ba73727ec37c5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad886f21681458f0e089ba73727ec37c5"></a>
<a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#ad886f21681458f0e089ba73727ec37c5">getSonar</a> (int sonarNumber)</td></tr>
<tr class="memdesc:ad886f21681458f0e089ba73727ec37c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal function to get the sonar (only useful between parseArgs and connectSonars) <br /></td></tr>
<tr class="separator:ad886f21681458f0e089ba73727ec37c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd6239ba6c0acaa757c0db378e1b3b42"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acd6239ba6c0acaa757c0db378e1b3b42"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#acd6239ba6c0acaa757c0db378e1b3b42">logOptions</a> (void) const </td></tr>
<tr class="memdesc:acd6239ba6c0acaa757c0db378e1b3b42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Log the options the simple connector has. <br /></td></tr>
<tr class="separator:acd6239ba6c0acaa757c0db378e1b3b42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86f06c9faff7c72293c85e6795d27227"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a86f06c9faff7c72293c85e6795d27227">parseArgs</a> (void)</td></tr>
<tr class="memdesc:a86f06c9faff7c72293c85e6795d27227"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to parse the arguments given in the constructor.  <a href="#a86f06c9faff7c72293c85e6795d27227">More...</a><br /></td></tr>
<tr class="separator:a86f06c9faff7c72293c85e6795d27227"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c88bd456c470deb69140c742bcf6270"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a0c88bd456c470deb69140c742bcf6270">parseArgs</a> (<a class="el" href="classArArgumentParser.html">ArArgumentParser</a> *parser)</td></tr>
<tr class="memdesc:a0c88bd456c470deb69140c742bcf6270"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to parse the arguments given in an arbitrary parser.  <a href="#a0c88bd456c470deb69140c742bcf6270">More...</a><br /></td></tr>
<tr class="separator:a0c88bd456c470deb69140c742bcf6270"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04948a35c2edd91e9441dfef0f66cac5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a04948a35c2edd91e9441dfef0f66cac5"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a04948a35c2edd91e9441dfef0f66cac5">replaceSonar</a> (<a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *sonar, int sonarNumber)</td></tr>
<tr class="memdesc:a04948a35c2edd91e9441dfef0f66cac5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal function to replace the sonar (only useful between parseArgs and connectSonars) but not the sonar data. <br /></td></tr>
<tr class="separator:a04948a35c2edd91e9441dfef0f66cac5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ef7a4f917e1cbe5c072435c0835a8d7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a0ef7a4f917e1cbe5c072435c0835a8d7">setupSonar</a> (<a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *sonar, int sonarNumber=1)</td></tr>
<tr class="memdesc:a0ef7a4f917e1cbe5c072435c0835a8d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets up a sonar to be connected.  <a href="#a0ef7a4f917e1cbe5c072435c0835a8d7">More...</a><br /></td></tr>
<tr class="separator:a0ef7a4f917e1cbe5c072435c0835a8d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8142dd593a44010ccec69cf9a197084a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8142dd593a44010ccec69cf9a197084a"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a8142dd593a44010ccec69cf9a197084a">~ArSonarConnector</a> (void)</td></tr>
<tr class="memdesc:a8142dd593a44010ccec69cf9a197084a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a8142dd593a44010ccec69cf9a197084a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a3bf393ad641eb1213fb0f9d40e002ccc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3bf393ad641eb1213fb0f9d40e002ccc"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>internalConfigureSonar</b> (<a class="el" href="classArSonarConnector_1_1SonarData.html">SonarData</a> *sonarData)</td></tr>
<tr class="separator:a3bf393ad641eb1213fb0f9d40e002ccc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1db5c669b7ec2f5e5dad7a04046bce2c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1db5c669b7ec2f5e5dad7a04046bce2c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a1db5c669b7ec2f5e5dad7a04046bce2c">logSonarOptions</a> (<a class="el" href="classArSonarConnector_1_1SonarData.html">SonarData</a> *sonardata, bool header=true, bool metaOpts=true) const </td></tr>
<tr class="memdesc:a1db5c669b7ec2f5e5dad7a04046bce2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Logs the sonar command line option help text. <br /></td></tr>
<tr class="separator:a1db5c669b7ec2f5e5dad7a04046bce2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bd7cf71907c3c1c6f65424cba371c75"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9bd7cf71907c3c1c6f65424cba371c75"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a9bd7cf71907c3c1c6f65424cba371c75">parseSonarArgs</a> (<a class="el" href="classArArgumentParser.html">ArArgumentParser</a> *parser, <a class="el" href="classArSonarConnector_1_1SonarData.html">SonarData</a> *sonarData)</td></tr>
<tr class="memdesc:a9bd7cf71907c3c1c6f65424cba371c75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parses the sonar arguments. <br /></td></tr>
<tr class="separator:a9bd7cf71907c3c1c6f65424cba371c75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ae11edd8e1b3cac18f3967fe1da0161"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArSonarConnector.html#a5ae11edd8e1b3cac18f3967fe1da0161">turnOnPower</a> (<a class="el" href="classArSonarConnector_1_1SonarData.html">SonarData</a> *sonarData)</td></tr>
<tr class="memdesc:a5ae11edd8e1b3cac18f3967fe1da0161"><td class="mdescLeft">&#160;</td><td class="mdescRight">Turns on the power for the specific board in the firmware.  <a href="#a5ae11edd8e1b3cac18f3967fe1da0161">More...</a><br /></td></tr>
<tr class="separator:a5ae11edd8e1b3cac18f3967fe1da0161"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a1911ab4a3a5f5e65ae88cf1dde715a0a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1911ab4a3a5f5e65ae88cf1dde715a0a"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myAutoParseArgs</b></td></tr>
<tr class="separator:a1911ab4a3a5f5e65ae88cf1dde715a0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7968829888917404fc2b957165ee8a5b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7968829888917404fc2b957165ee8a5b"></a>
<a class="el" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3">ArLog::LogLevel</a>&#160;</td><td class="memItemRight" valign="bottom"><b>myInfoLogLevel</b></td></tr>
<tr class="separator:a7968829888917404fc2b957165ee8a5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf913bd45faf489a312fefab2e5f128f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf913bd45faf489a312fefab2e5f128f"></a>
<a class="el" href="classArConstFunctorC.html">ArConstFunctorC</a>&lt; <a class="el" href="classArSonarConnector.html">ArSonarConnector</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>myLogOptionsCB</b></td></tr>
<tr class="separator:adf913bd45faf489a312fefab2e5f128f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bac65865c905d74d342ef5cb3be06ba"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8bac65865c905d74d342ef5cb3be06ba"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myOwnParser</b></td></tr>
<tr class="separator:a8bac65865c905d74d342ef5cb3be06ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a9c17aeafccfee4e82b14627bc461bb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a9c17aeafccfee4e82b14627bc461bb"></a>
<a class="el" href="classArRetFunctorC.html">ArRetFunctorC</a>&lt; bool, <a class="el" href="classArSonarConnector.html">ArSonarConnector</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>myParseArgsCB</b></td></tr>
<tr class="separator:a4a9c17aeafccfee4e82b14627bc461bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62c0fef7011d418d53933f0c7a3c1fe0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a62c0fef7011d418d53933f0c7a3c1fe0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myParsedArgs</b></td></tr>
<tr class="separator:a62c0fef7011d418d53933f0c7a3c1fe0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24a40a17b73ec498ba06f5c932244652"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a24a40a17b73ec498ba06f5c932244652"></a>
<a class="el" href="classArArgumentParser.html">ArArgumentParser</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>myParser</b></td></tr>
<tr class="separator:a24a40a17b73ec498ba06f5c932244652"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c1bc756d96706184de63c7b74479cbe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9c1bc756d96706184de63c7b74479cbe"></a>
<a class="el" href="classArRobot.html">ArRobot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>myRobot</b></td></tr>
<tr class="separator:a9c1bc756d96706184de63c7b74479cbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93c101deada8554b3f34d38f281270d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a93c101deada8554b3f34d38f281270d7"></a>
<a class="el" href="classArRobotConnector.html">ArRobotConnector</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>myRobotConnector</b></td></tr>
<tr class="separator:a93c101deada8554b3f34d38f281270d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bc74a49aa691d6e1aee56913221bbd5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bc74a49aa691d6e1aee56913221bbd5"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mySonarLogPacketsReceived</b></td></tr>
<tr class="separator:a5bc74a49aa691d6e1aee56913221bbd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00117646898d6acc4d1faf13f8bd00d1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a00117646898d6acc4d1faf13f8bd00d1"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mySonarLogPacketsSent</b></td></tr>
<tr class="separator:a00117646898d6acc4d1faf13f8bd00d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17c4dedbf2f29b44f04708d61db77ae2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a17c4dedbf2f29b44f04708d61db77ae2"></a>
std::map&lt; int, <a class="el" href="classArSonarConnector_1_1SonarData.html">SonarData</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mySonars</b></td></tr>
<tr class="separator:a17c4dedbf2f29b44f04708d61db77ae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1da4a5056651ba5a7184cfa386096302"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1da4a5056651ba5a7184cfa386096302"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>mySonarTypes</b></td></tr>
<tr class="separator:a1da4a5056651ba5a7184cfa386096302"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac99980185128f294dc4b16d4f49fa70c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac99980185128f294dc4b16d4f49fa70c"></a>
<a class="el" href="classArRetFunctor1.html">ArRetFunctor1</a>&lt; bool, const char * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><b>myTurnOffPowerOutputCB</b></td></tr>
<tr class="separator:ac99980185128f294dc4b16d4f49fa70c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a786f314f55e433e13b55cc3d9d1a4745"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a786f314f55e433e13b55cc3d9d1a4745"></a>
<a class="el" href="classArRetFunctor1.html">ArRetFunctor1</a>&lt; bool, const char * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><b>myTurnOnPowerOutputCB</b></td></tr>
<tr class="separator:a786f314f55e433e13b55cc3d9d1a4745"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Connect to sonar based on robot parameters and command-line arguments. </p>
<p><a class="el" href="classArSonarConnector.html" title="Connect to sonar based on robot parameters and command-line arguments. ">ArSonarConnector</a> makes a sonar connection either through a serial port connection. When you create your <a class="el" href="classArSonarConnector.html" title="Connect to sonar based on robot parameters and command-line arguments. ">ArSonarConnector</a>, pass it command line parameters via either the argc and argv variables from main(), or pass it an <a class="el" href="classArArgumentBuilder.html" title="This class is to build arguments for things that require argc and argv. ">ArArgumentBuilder</a> or <a class="el" href="classArArgumentParser.html" title="Parse and store program command-line arguments for use by other ARIA classes. ">ArArgumentParser</a> object. (<a class="el" href="classArArgumentBuilder.html" title="This class is to build arguments for things that require argc and argv. ">ArArgumentBuilder</a> is able to obtain command line parameters from a Windows program that uses WinMain() instead of main()). <a class="el" href="classArSonarConnector.html" title="Connect to sonar based on robot parameters and command-line arguments. ">ArSonarConnector</a> registers a callback with the global <a class="el" href="classAria.html" title="Contains global initialization, deinitialization and other global functions. ">Aria</a> class. Use <a class="el" href="classAria.html#a1b090c01d88bb420b8cf8e0384d25ee1" title="Parses the arguments for the program (calls all the callbacks added with addParseArgsCB()) ...">Aria::parseArgs()</a> to parse all command line parameters to the program, and <a class="el" href="classAria.html#a10d71f3d4d0cf7f38c58a1f749f64a42" title="Logs all the options for the program (Calls all the callbacks added with addLogOptionsCB()) ...">Aria::logOptions()</a> to print out information about all registered command-line parameters.</p>
<p>The following command-line arguments are checked: </p><pre class="fragment">Options for ArSonarConnector:
-sonarLogPacketsReceived
-slpr
-sonarLogPacketsSent
-slps

Options shown are for currently set up sonars.  Activate sonars with -sonarType&lt;N&gt; option
to see options for that sonar (e.g. "-help -sonarType1 sonarMTX").
Valid sonar types are: mtx

See docs for details.
</pre><p>To connect to any sonars that were set up in the robot parameter file or via command line arguments, call <a class="el" href="classArSonarConnector.html#aff4cf06b8187ee5c758c81381a4fe7e4" title="Connects all the sonars the robot has that should be auto connected. ">connectSonars()</a>. If successful, <a class="el" href="classArSonarConnector.html#aff4cf06b8187ee5c758c81381a4fe7e4" title="Connects all the sonars the robot has that should be auto connected. ">connectSonars()</a> will return true and add an entry for each sonar connected in the <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> object's list of sonars. These <a class="el" href="classArSonarMTX.html" title="Receives sonar data from an MTX robot Use ArSonarConnector to establish the connection and create and...">ArSonarMTX</a> objects can be accessed from your <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> object via <a class="el" href="classArRobot.html#a6692abd7564b44e8d57a6536afcb1456" title="Finds a sonar in the robot&#39;s list (sonarNumber indices start at 1) (MTX robots only) ...">ArRobot::findSonar()</a> or <a class="el" href="classArRobot.html#aa629f77cf3bfa0f8018a174664ee3b12" title="Gets the sonar list (MTX robots only) ">ArRobot::getSonarMap()</a>.</p>
<dl class="section since"><dt>Since</dt><dd>2.8.0 </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ac37f03297a9f3158a7f1daf5bdb40de3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ArSonarConnector::ArSonarConnector </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArArgumentParser.html">ArArgumentParser</a> *&#160;</td>
          <td class="paramname"><em>parser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classArRobot.html">ArRobot</a> *&#160;</td>
          <td class="paramname"><em>robot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classArRobotConnector.html">ArRobotConnector</a> *&#160;</td>
          <td class="paramname"><em>robotConnector</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>autoParseArgs</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3">ArLog::LogLevel</a>&#160;</td>
          <td class="paramname"><em>infoLogLevel</em> = <code><a class="el" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a6e80d09c67dad73e9ba736e91ec893be">ArLog::Verbose</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classArRetFunctor1.html">ArRetFunctor1</a>&lt; bool, const char * &gt; *&#160;</td>
          <td class="paramname"><em>turnOnPowerOutputCB</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classArRetFunctor1.html">ArRetFunctor1</a>&lt; bool, const char * &gt; *&#160;</td>
          <td class="paramname"><em>turnOffPowerOutputCB</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor that takes argument parser. </p>
<dl class="section warning"><dt>Warning</dt><dd>do not delete <em>parser</em> during the lifetime of this <a class="el" href="classArSonarConnector.html" title="Connect to sonar based on robot parameters and command-line arguments. ">ArSonarConnector</a>, which may need to access its contents later. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>the parser with the arguments to parse </td></tr>
    <tr><td class="paramname">robot</td><td>the robot these sonars are attached to (or NULL for none) </td></tr>
    <tr><td class="paramname">robotConnector</td><td>the connector used for connecting to the robot (so we can see if it was a sim or not) </td></tr>
    <tr><td class="paramname">autoParseArgs</td><td>if this class should autoparse the args if they aren't parsed explicitly </td></tr>
    <tr><td class="paramname">infoLogLevel</td><td>The log level for information about creating sonars and such, this is also passed to all the sonars created as their infoLogLevel too </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a8746703bfabfac28f5165ac21e56a998"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArSonarConnector::addSonar </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *&#160;</td>
          <td class="paramname"><em>sonar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sonarNumber</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a sonar so parsing will get it. </p>
<p>Normally adding sonars is done from the .p file, you can use this if you want to add them explicitly in a program (which will override the .p file, and may cause some problems).</p>
<p>This is mainly for backwards compatibility (ie used for <a class="el" href="classArSimpleConnector.html" title="Legacy connector for robot and laser. ">ArSimpleConnector</a>). If you're using this class you should probably use the new functionality which is just <a class="el" href="classArSonarConnector.html#aff4cf06b8187ee5c758c81381a4fe7e4" title="Connects all the sonars the robot has that should be auto connected. ">ArSonarConnector::connectSonars</a>.() </p>

</div>
</div>
<a class="anchor" id="af2804f2cf1e774e01ff01796fab62380"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArSonarConnector::connectSonar </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *&#160;</td>
          <td class="paramname"><em>sonar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sonarNumber</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>forceConnection</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connects the sonar synchronously (will take up to a minute) </p>
<p>This is mainly for backwards compatibility (ie used for <a class="el" href="classArSimpleConnector.html" title="Legacy connector for robot and laser. ">ArSimpleConnector</a>).</p>
<p>If you're using this class you should probably use the new functionality which is just <a class="el" href="classArSonarConnector.html#aff4cf06b8187ee5c758c81381a4fe7e4" title="Connects all the sonars the robot has that should be auto connected. ">ArSonarConnector::connectSonars()</a>. </p>

</div>
</div>
<a class="anchor" id="a86f06c9faff7c72293c85e6795d27227"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArSonarConnector::parseArgs </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to parse the arguments given in the constructor. </p>
<p>Parse command line arguments using the <a class="el" href="classArArgumentParser.html" title="Parse and store program command-line arguments for use by other ARIA classes. ">ArArgumentParser</a> given in the <a class="el" href="classArSonarConnector.html" title="Connect to sonar based on robot parameters and command-line arguments. ">ArSonarConnector</a> constructor.</p>
<p>See <a class="el" href="classArSonarConnector.html#a0c88bd456c470deb69140c742bcf6270" title="Function to parse the arguments given in an arbitrary parser. ">parseArgs(ArArgumentParser*)</a> for details about argument parsing.</p>
<dl class="section return"><dt>Returns</dt><dd>true if the arguments were parsed successfully false if not </dd></dl>

</div>
</div>
<a class="anchor" id="a0c88bd456c470deb69140c742bcf6270"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArSonarConnector::parseArgs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArArgumentParser.html">ArArgumentParser</a> *&#160;</td>
          <td class="paramname"><em>parser</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to parse the arguments given in an arbitrary parser. </p>
<p>Parse command line arguments held by the given <a class="el" href="classArArgumentParser.html" title="Parse and store program command-line arguments for use by other ARIA classes. ">ArArgumentParser</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>true if the arguments were parsed successfully false if not</dd></dl>
<p>The following arguments are accepted for sonar connections. A program may request support for more than one sonar using setMaxNumSonarBoards(); if multi-sonar support is enabled in this way, then these arguments must have the sonar index number appended. For example, "-sonarPort" for sonar 1 would instead by "-sonarPort1", and for sonar 2 it would be "-sonarPort2". </p><dl>
<dt>-sonarPort <em>port</em> </dt>
<dd></dd>
<dt>-sp <em>port</em> </dt>
<dd>Use the given port device name when connecting to a sonar. For example, <code>COM2</code> or on Linux, <code>/dev/ttyS1</code>.  </dd>
<dt>-doNotConnectSonar </dt>
<dd></dd>
<dt>-dncs </dt>
<dd></dd>
</dl>

</div>
</div>
<a class="anchor" id="a0ef7a4f917e1cbe5c072435c0835a8d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArSonarConnector::setupSonar </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArSonarMTX.html">ArSonarMTX</a> *&#160;</td>
          <td class="paramname"><em>sonar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sonarNumber</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets up a sonar to be connected. </p>
<p>This is mainly for backwards compatibility (ie used for <a class="el" href="classArSimpleConnector.html" title="Legacy connector for robot and laser. ">ArSimpleConnector</a>).</p>
<p>If you're using this class you should probably use the new functionality which is just <a class="el" href="classArSonarConnector.html#aff4cf06b8187ee5c758c81381a4fe7e4" title="Connects all the sonars the robot has that should be auto connected. ">ArSonarConnector::connectSonars()</a>. </p>

</div>
</div>
<a class="anchor" id="a5ae11edd8e1b3cac18f3967fe1da0161"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool ArSonarConnector::turnOnPower </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArSonarConnector_1_1SonarData.html">SonarData</a> *&#160;</td>
          <td class="paramname"><em>sonarData</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Turns on the power for the specific board in the firmware. </p>
<p>MPL the new way </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>ArSonarConnector.h</li>
<li>ArSonarConnector.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classArSonarConnector.html">ArSonarConnector</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
